/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package receiver;

/**
 *
 * @author Dunekacke
 */
import java.util.Scanner;


public class config {
	public static void main(String args[]) 
	{
		run();
	
		System.out.println("Exiting Program....");
	}
	
	public static void run() 
	{
		String comand = "";
                Alternating server = null;
		Scanner scanner = new Scanner(System.in);
		do {
			System.out.println("+--------------------------+");
			System.out.println("+ Please choose an option. +");
			System.out.println("+                          +");
			System.out.println("+ 1: Alternating Bit       +");
                        System.out.println("+ 2: exit                  +");
			System.out.println("+--------------------------+");
			System.out.print("Choice : ");
			
			String input = scanner.nextLine();
			char option = input.charAt(0);
			if(option == '1') 
			{
				System.out.println("          | |");
				System.out.println("          | |");
				System.out.println("          \\ /");
				System.out.println("       +---------------------------------+");
				System.out.println("       + Starting Alteranting Bit Server +");
				System.out.println("       +---------------------------------+");
				// TO DO ALTERNATING BIT
				server = new Alternating();
				server.run();
			} 
                        else if (option == '2')
                        {
                            return;
                        }
                        else
                        {
                            System.out.println("No correct choice.");
                        }
                        do {
                        System.out.println("continue? (y or n)");
			comand = scanner.nextLine();
                        }while (!comand.equals("y") && !comand.equals("n"));
		} while(!comand.equals("n"));
	}
}

